<template>
  <div>
    <TypeNav/>
    <List/>
    <Recommend/>
    <Rank/>
    <Like/>
    <Floor v-for="floor in floorList" :key="floor.id" :floor="floor"/>
    <Brand/>
  </div>
</template>

<script>
import {getMockFloor} from '@/api';
import List from './components/List';
import Recommend from './components/Recommend';
import Rank from './components/Rank';
import Like from './components/Like';
import Floor from './components/Floor';
import Brand from './components/Brand';

export default {
  name: 'Home',
  components: {
    List,
    Recommend,
    Rank,
    Like,
    Floor,
    Brand,
  },
  data() {
    return {
      floorList: [],
    };
  },
  mounted() {
    //1.初始化请求所有floor的数据
    this.getFloorList();
  },
  methods: {
    //1. 初始化请求所有floor的数据的方法
    async getFloorList() {
      this.floorList = await getMockFloor();
    },
  },
};
</script>

<style></style>
